package com.guodi.model.utils;

import java.util.ArrayList;
import java.util.List;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class RegularUtils {

    private static Pattern pattern = Pattern.compile("\"(.*?)\"");

    /**
     * @描述: 抽取字符串里面所有双引号的内容
     * @入参: 待处理数据："A" + "B" / "C" = "D"
     * @出参: list集合：[A,B,C,D]
     * @作者: lzy
     * @日期: 2020/11/7 15:58
     **/
    public static List<String> extractString(String data){
        Matcher m = pattern.matcher(data);
        List<String> list = new ArrayList<String>();
        while (m.find()) {
            list.add(m.group().trim().replace("\"","")+"");
        }
        return list;
    }
}
